<template>
  <div class="index-message sub-margin">
    <div class="sub-page-title">系统消息</div>
    <div class="content">
      <div class="left-con">
        <TabsList @change="tabsChange" ref="tabs" />
      </div>
      <div class="right-con">
        <MessageList :messageType="messageType" @changeState="changeState" />
      </div>
    </div>
  </div>
</template>

<script>
import TabsList from './components/TabsList'
import MessageList from './components/MessageList'
export default {
  name: 'indexMessage',
  components: { TabsList, MessageList },
  props: {},
  data() {
    return {
      messageType: '',
    }
  },
  watch: {},
  computed: {},
  created() {},
  mounted() {},
  methods: {
    tabsChange(id) {
      this.messageType = id
    },
    changeState(type) {
      this.$refs.tabs.reviewData(type)
    },
  },
}
</script>
<style lang="scss" scoped>
@import '@styles/layout.scss';

.index-message {
  display: flex;
  flex-direction: column;
  height: calc(100% - 20px);
  overflow: hidden;

  .content {
    flex: 1;
    display: flex;
    align-items: stretch;
    padding: 20px 0;
    height: calc(100% - 50px);

    .left-con {
      width: 300px;
      height: 100%;
      overflow: auto;
      position: relative;
      border-right: 1px solid #e4eaf0;
    }

    .right-con {
      flex: 1;
      width: 100%;
      max-width: 1200px;
      margin: 0 auto;
      margin-left: 20px;
      position: relative;
      display: flex;
      flex-direction: column;
    }
  }
}
</style>
